package com.sun.dao.user;

import com.sun.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * @Author Sun
 * @Date 2020/4/25 10:36
 * @Version 1.0
 */
public interface UserDao {

    //得到要登陆的用户，返回一个User实体
    public User getLoginUser(Connection connection, String userCode, String password) throws SQLException;

    //修改密码，返回受影响的行数
    public int updatepwd(Connection connection, int id, String password) throws SQLException;

    //根据输入的用户名或角色查询用户总数
    public int getUserCount(Connection connection, String userName, int userRole) throws SQLException;

    //分页查询用户列表
    public List<User> getUserList(Connection connection, String userName, int userRole,int currentPageNo, int pageSize) throws SQLException;

    //添加用户，返回受影响的行数
    public int addUser(Connection connection,User user);
}
